Skip to content

fix(wrapper): finalize HTTP bodies on trailers and support streaming trailer pauses - #57

Open
EndlessSeeker wants to merge 2 commits into
mainfrom
codex/a2a-trailers-pr
Open

EndlessSeeker wants to merge 2 commits into
mainfrom
codex/a2a-trailers-pr

Conversation

@EndlessSeeker

@EndlessSeeker EndlessSeeker commented Sep 6, 2026 •

Copy link
Copy Markdown

Summary

Buffered request/response handlers currently miss messages that end in HTTP trailers instead of a DATA end-of-stream flag. This can skip request validation and response metadata/Card rewriting. Finalize these bodies exactly once on either termination path, preserving the handler's pause/continue action.

Also add ProcessResponseTrailers so a streaming handler can hold trailers until preceding asynchronous body work completes. Streaming responses do not invoke the buffered body handler.

Verification

  • go test ./... passes on Linux/amd64 with Go 1.26.5, including empty and multi-chunk bodies, once-only finalization, action propagation, and streaming trailer pauses.
  • Tests register the current SDK get_log_level host function in the emulator.
  • Real HTTP/2 gateway verification passed in companion Higress #4650: the same 34 requests against the original and fixed plugins reproduce and then fix skipped request validation, missing Agent Card rewriting and missing unary metadata when messages terminate in trailers. Each defect is repeated three times per source. The fixed SDK also passes cross-gateway task/context affinity, delayed SSE and Redis failure during streaming. Exact commands, results and artifact hashes.
  • Runtime-tested SDK commit 35813546bdbe882693a4a37c8e1e736e34c78210 is retained on codex/a2a-trailers-tested for the public module pin. PR head 310bc001694a501badbaca42d99b1fc7143016a6 has the identical source tree; only author/committer and DCO sign-off metadata changed (git diff 35813546bdbe882693a4a37c8e1e736e34c78210 310bc001694a501badbaca42d99b1fc7143016a6 is empty).

Agent disclosure

Implemented and tested with OpenAI Codex at maintainer EndlessSeeker's request. The request was to validate A2A client/server communication through Higress, including HTTP/2 trailers and stateful endpoint affinity. No protocol-specific logic is added to the SDK.

@CLAassistant

CLAassistant commented Sep 6, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

…er pauses

Change-Id: I11f364b7daa8dc1f4561abbab0f70502bf2f94e6
Signed-off-by: EndlessSeeker <1766508902@qq.com>
Change-Id: I687cbf31b9d3a1a682b8a46f25febe89b3206939
Signed-off-by: EndlessSeeker <1766508902@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants